import java.util.ArrayList;
import java.util.Random;


public class Deck {

	//var
	private ArrayList<Card> mydeck;
	
	
	
	
	//con
	
	public Deck() {
		mydeck = new ArrayList<Card>();
			for(int Q=0;Q<13;Q++) {
				mydeck.add(new Card(Suit.SPADES, Q+1));
				mydeck.add(new Card(Suit.CLUBS, Q+1));
				mydeck.add(new Card(Suit.DIAMONDS, Q+1));
				mydeck.add(new Card(Suit.HEARTS, Q+1));

		}
		
	}
	
	
	
	
	//meth
	
	/**
	 * Draws a card and returns
	 * 
	 **/
	
	public Card draw() {
		
		
		
		return mydeck.remove(0);
	}
	
	
	public void shuffle() {
		
		Random gen = new Random();
		
		for(int i=0;i<200;i++) {
		mydeck.add(mydeck.remove(gen.nextInt(mydeck.size())));

		}

	}




	@Override
	public String toString() {
		String temp = "";
		for(int i=0;i<mydeck.size();i++) {
			temp += mydeck.get(i);
		}
		
		return temp;
	}
	
	
	
	
	
}
